#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
const int N = 10;
int n, k,cnt=0;
char map[N][N];
bool use_col[N] ;
void dfs(int row,int num)
{
	
	if (num == k)
	{
		cnt++;
		return;
	}
	if (row >= n)return;
	for (int i = 0; i < n; i++)
	{
		if (map[row][i] == '#' && !use_col[i])
		{
			use_col[i] = true;
			dfs(row + 1, num + 1);
			use_col[i] = false;
		}
	}
	dfs(row + 1, num);
}
int main()
{
	while (1)
	{
		scanf("%d%d", &n, &k);
		if (n == -1 && k == -1)break;
		for (int i = 0; i < n; i++)
		{
			scanf("%s", map[i]);
		}
		dfs(0,0);
		printf("%d\n", cnt);
		cnt = 0;
	}
	return 0;
}